﻿Public Partial Class BillTo_Popup
    Inherits System.Web.UI.Page

    Dim clsGet As New ClassFunctionGetData
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not (Session("CUSTOMER_SOLD_TO") Is Nothing) Then
                LoadData(Session("CUSTOMER_SOLD_TO") & "")
            End If

        End If
    End Sub

    Private Sub LoadData(ByVal Customer As String)
        Dim dtCus As DataTable = clsGet.Get_BillTo_For_Other(Customer)
        gridBillTO.DataSource = dtCus
        gridBillTO.DataBind()

    End Sub

    Private Sub gridBillTO_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gridBillTO.RowCommand
        Dim Index As Integer = Convert.ToInt32(e.CommandArgument)
        If e.CommandName = "Edit" Then
            Session("CUSTOMER_SOLD_TO") = gridBillTO.DataKeys(Index).Values("Bill_to") & "-" & gridBillTO.DataKeys(Index).Values("NAME")
            ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), "myscript", " parent.closeModal('B');", True)
        End If
    End Sub

    Private Sub gridBillTO_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles gridBillTO.RowEditing

    End Sub
End Class